package com.jereh.topnews.demo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.jereh.topnews.R;

public class ListDemoActivity extends AppCompatActivity {
    private ListView list;
    private ArrayAdapter adapter;
    private String[] texts={"我的收藏","我的信息","我的留言","我的评论","我的代码"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_list_demo);
        //找控件
        list=(ListView)findViewById(R.id.list);
        adapter=new ArrayAdapter(this,R.layout.adapter_array_demo,R.id.text,texts);
        list.setAdapter(adapter);
    }
}
